<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\ResourceCollection;
use Moell\Mojito\Http\Controllers\AdminUserController as MojitoAdminUserController;
use Moell\Mojito\Resources\AdminUserCollection;

class AdminUserController extends MojitoAdminUserController
{
    /**
     * @author moell<moel91@foxmail.com>
     * @param Request $request
     * @return AdminUserCollection
     */
    public function index(Request $request)
    {
        return new AdminUserCollection($this->adminUserModel->where(request_intersect(['name', 'email']))->where('pid', 0)->paginate());
    }
}
